import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
    routes: [
    	{
    		path:'',
	        redirect:"home"
	    },
      {
        path: '/welcome',
        component: resolved => { require(['pages/Welcome'], resolved)}
      },
      {
        path: '/login',
        component: resolved => {require(['pages/login'], resolved)}
      },
    	{
    		path:'/home',
	        component: resolve => { require(['pages/main'], resolve) },
	        children:[
	        	{
		    		  path:'',
			        redirect:'index'
		    	  },
	        	{
	        		name:'index',
		    		  path:'index',
			        component: resolve => { require(['pages/index'], resolve) }
		    	},
          {
            name: 'admin',
            path: 'admin',
            component: resolve => { require(['pages/admin/index'], resolve) }
          },
		    	{
		    		name:"mine",
		    		path:'mine',
			        component: resolve => { require(['pages/Mine'], resolve) }
		    	}
	        ]
    	},
      {
        path: '/tourist/detail',
        name: 'touristDetail',
        component: resolve => {require(['pages/tourist/TouristDetail'], resolve)}
      },
      {
        path: '/room/detail',
        name: 'touristRoomDetail',
        component: resolve => {require(['pages/tourist/TouristRoomDetail'], resolve)}
      },
      {
        path: '/tourist/detailadmin',
        name: 'touristDetailAdmin',
        component: resolve => {require(['pages/tourist/TouristDetailAdmin'], resolve)}
      },
      {
        path: '/tourist/edit',
        name: 'touristEdit',
        component: resolve => {require(['pages/tourist/TouristDetailEdit'], resolve)}
      },
      {
        name: 'profile',
        path: '/mine/profile',
        component: resolve => { require(['pages/mine/Profile'], resolve)}
      },
      {
          name: 'TouristDetailBookedUsers',
          path: '/tourist/bookedusers',
          component: resolve => { require(['pages/tourist/TouristDetailBookedUsers'], resolve)}
      },
	]
})
